<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<style>
.planned{
	background-color:#65b201;
}
.started{
	background-color:#af1a0e;
}
.completed{
	background-color:#326ca2;
}
.onhold{
	background-color:#c108bf;
}
.off{
	background-color:#777777;
}	
</style>
<c:forEach items="${list}" var="task" varStatus="c">
<div id="task${c.count}">
	<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" bordercolor="#000000">
		<tr>
			<td width="611">
			<b>
			<img src="/img/arrow_down_mini.gif" />
			<!-- a title="${task.title}"  href="javascript:;" onclick="openwindow('来自${task.user.groups.title}${task.user.nickname}的工作总结-${task.title}','summaryView.servlet?id=${task.id}&userid=${task.user.id}');" -->
			<a title="${task.subsummary}"  href="javascript:;" onclick="show('summary${c.count}');">
			<span style="font-size: 14px">${task.title}</span></a></b>&nbsp;&nbsp;[${task.createtime}] - <font color="#cdcdcd" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: 微软雅黑; font-size: 12px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
			[<a href="javascript:;" title="${task.user.groups.title}" onclick="loadhtml('summarylist','/BMS/summarylist.servlet?userid=&groups=${task.user.groups.id}');"><font color="#cdcdcd">${task.user.groups.title}</font></a>]
			</font>
			<span style="color: rgb(52, 45, 126); font-family: 微软雅黑; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; "><span class="Apple-converted-space">&nbsp;</span>-<span class="Apple-converted-space">&nbsp;</span></span><font color="#cdcdcd" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: 微软雅黑; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><a href="javascript:;" onclick="loadhtml('summarylist','/BMS/summarylist.servlet?userid=${task.user.id}&groups=');" title="查看${task.user.nickname}发布的总结"><font color="#cdcdcd">${task.user.nickname}</font></a></font>
			
			</td>
		</tr>
		<tr>
			<td width="611">
				<div >
					
				</div>
			</td>
		</tr>
		<tr>
			<td width="611">
				<div id="summary${c.count}" style="display:none;margin:5px 0px 0px 0px">
					<table border="1" cellpadding="0" style="border-collapse: collapse" width="100%" height="19" bordercolor="#CCCCCC">
						<tr>
							<td>
								<div style="margin:10px">
									<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" height="19" bordercolor="#000000">
										<tr>
											<td align="right"><a href="javscript:;" onclick="hide('summary${c.count}');" title="关闭"><img src="/img/cancel.png"/></a></td>
										</tr>
										<tr>
											<td><p style="text-indent: 2px; line-height: 150%">${task.summary}</p></td>
										</tr>
										<tr>
											<td align="right">发布日期:${task.createtime}</td>
										</tr>
									</table>
								</div>
							</td>
						</tr>
					</table>
					
				</div>
			</td>
		</tr>
	</table>
	<div  id="addcomment${c.count}" style="display:none;" >
		<hr color="#CCCCCC" size="0" />
		<input type="hidden" id="eventid${c.count}" name="eventid" value="${task.id}" />
		<textarea title="填写${task.title}的计划进度" rows="7" id="content${c.count}" name="content" cols="91" style="border: 1px dotted #CCCCCC"></textarea><br/>
		<input id="addcommentis${c.count}" class="btn btn-red" onclick="addcomment('eventid${c.count}','content${c.count}','addcomment${c.count}');" name="button" type="submit" value="添加计划进度" /> 或者
		<a href="javascript:;" onclick="hide('addcomment${c.count}')">取消</a>
	</div>
	<hr color="#CCCCCC" size="0" />
</div>
</c:forEach>
<script type="text/javascript" >
$(document).ready(function(){
	Administry.setup();
});
function deleteTask(taskid,divid,title){
	Boxy.DEFAULTS.title = '确认删除计划:'+title+'?';
	Boxy.confirm(Boxy.DEFAULTS.title,
	function() {
		gourl('/BMS/deleteTask.servlet?id='+taskid,'get'),
		
		hide(divid);
		mess('删除计划'+title+'成功');
	});
}


function addcomment(eventid,content,divid){
	var eventid =new $("#"+eventid).val();
	var content = new $("#"+content).val();
	$.ajax({
		url : '/BMS/addComment.servlet?eventid='+
			  eventid+'&content='+encodeURIComponent(content),
		type : 'post',
		contentType: "application/x-www-form-urlencoded; charset=utf-8",
		error : function() {
			
			mess('添加计划进度失败,请联系系统管理员');
			hide(divid);
			return false;
		},
		success : function(data) {
			mess('添加计划进度成功');
			hide(divid);
			return false;
		}
	});
}

</script>
